/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package ejercicio9;

import java.math.BigDecimal;

/**
 *
 * @author DAM107
 */
public class Venta {
    private float pvp;
    private int descuento;
    private int iva;

    public Venta(float pvp, int descuento, int iva) {
        this.pvp = pvp;
        this.descuento = descuento;
        this.iva = iva;
    }

    public int getDescuento() {
        return descuento;
    }

    public int getIva() {
        return iva;
    }

    public float getPvp() {
        return pvp;
    }

    float calculaDescuento(){
       return pvp*descuento/100;
    }

    float calculaIva(){
       return (pvp-this.calculaDescuento())*iva/100;
    }
    BigDecimal calculaEuros(){
	return new BigDecimal(this.calculaPrecio()).setScale(2,BigDecimal.
		ROUND_HALF_UP);
    }

 private   float calculaPrecio(){
        return pvp-this.calculaDescuento()+this.calculaIva();
    }
}
